import random
import requests

# 模拟完整浏览器请求头（包含更多用户标识信息）
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
    "Accept-Encoding": "gzip, deflate, br",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Connection": "keep-alive",
    "Upgrade-Insecure-Requests": "1"
}
# res = requests.get("https://news.66wz.com/pic/003/012/986/00301298612_2b05d214.jpg",headers=headers)
# # print(res.content)
#
# with open('test.jpg', 'wb') as f:
#     f.write(res.content)

res = requests.get("https://cdn2.zzzmh.cn/wallpaper/origin/96eaf850880911ebb6edd017c2d2eca2.jpg?response-content-disposition=attachment&auth_key=1709222400-05fa38359aefbdb5af319a5eaa8502dafc0c22eb-0-c606b2d504258a39b9c119184555c780",headers=headers)

with open("美女2.jpg","wb") as f:
    f.write(res.content)
